package pers.liyan.shi.springcloud.producerticketclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pers.liyan.shi.springcloud.producerticketclient.client.hystrix.HystrixClientFallbackFactory;
import pers.liyan.shi.springcloud.producerticketclient.domain.Ticket;
import pers.liyan.shi.springcloud.producerticketclient.client.hystrix.HystrixClientFallback;

/**
 * producer-ticket 微服务暴露接口
 *
 * @author shily
 * @date 2019/4/21 0:46
 */
@FeignClient(name = "producer-ticket", /*fallback = HystrixClientFallback.class,*/ fallbackFactory = HystrixClientFallbackFactory.class)
public interface TicketClient {

    /**
     * 买票
     *
     * @param movieName 电影名
     * @return pers.liyan.shi.springcloud.producerticketclient.domain.Ticket
     * @throws
     * @author shily
     * @date 2019/4/21 0:49
     */
    @GetMapping("/ticket")
    public Ticket buyTicket(@RequestParam("movieName") String movieName);

}
